package cn.ehanghai.htz.service;

import cn.ehanghai.htz.domain.ServiceInfo;
import cn.ehanghai.htz.mapper.ServiceInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: xumf
 * @Date: 2019/7/18 18:03
 */
@Service
public class ServiceInfoService {

    @Autowired
    private ServiceInfoMapper serviceInfoMapper;

    /**
     * 查看服务配置信息
     * @return
     */
    public  ServiceInfo select(){
        List<ServiceInfo> list= serviceInfoMapper.selectAll();
        if(list.isEmpty()){
            return null;
        }
        return list.get(0);
    }

    /**
     * 新增
     * @param serviceInfo
     */
    public void insert(ServiceInfo serviceInfo){
        serviceInfoMapper.insert(serviceInfo);
    }
}
